[Contents] [Index] [Help] [Browse <] [Browse >]
ARexx Modules
--------------------------------- -- -  -
ARexx Modules are ARexx scripts which are installed in the DOpus5:Modules
directory. They must have the suffix .dopus5 to work correctly.

Each ARexx Module can add new internal commands to Opus.

Once both Opus 5 and ARexx have been started on the computer, the
DOpus5:Modules directory will be scanned for ARexx Modules and each will
have its init function called. Every ARexx Module must have an init
function or else it will not work. This is the function that adds the extra
commands to Opus.

The scripts are called with 4 or more parameters. The first 4 are always
provided - the portname of Directory Opus 5 and the function name, followed
by the source and destination lister handles. Any user-supplied arguments
to the function will follow.

Note that although the source and destination lister handle arguments are
always given when your script is called, they will always be zero unless
you specified that you wanted source and/or destination handles when
you added the command. 

You can add as many commands as you like. To add commands, use the
 dopus command  command.

Here is a complete example of an ARexx Module:-


/* Example Directory Opus 5 ARexx Module */

parse arg portname function source dest arguments
address value portname
options results

/* Initialise */

if function='init' then do
        dopus command "Test1" program "test-command" desc "'Test command 1'" template "TEST/S"
        dopus command "Test2" program "test-command" desc "'Test command 2'" "source"
        exit
        end


/* Test function 1 */

if function='Test1' then do
        dopus request "'Test command 1 received!'" "Ok"
        exit
        end


/* Test function 2 */

if function='Test2' then do
        str="'Test command 2 received - source handle " || source
        dopus request str "Ok"
        exit
        end



Converted on 04 Nov 1998 with RexxDoesAmigaGuide2HTML 2.2 by Michael Ranner.